package com.leyou.service;

import com.leyou.dto.SearchParamDTO;
import com.leyou.entity.Goods;
import com.leyou.starter.elastic.dto.PageInfo;
import reactor.core.publisher.Mono;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @author jshstart
 * @creat 2020-12-15 21:42
 */
public interface SearchService {
    /**
     * 创建索引库并设置映射
     */
    void createIndexAndMapping();

    /**
     * 加载数据到索引库
     */
    void loadData();

    Mono<List<String>> queryBySuggest(String key);

    Mono<PageInfo<Goods>> searchByPage(SearchParamDTO searchParamDTO);

    void saveGoodBySpuId(Long spuId);

    void deleteGoodBySpuId(Long spuId);

      Map<String,List<?>>  searchByAgg(SearchParamDTO searchParamDTO) throws IOException;
}